package models.re.simulatedData;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;

import models.aaa.Asset.Type;
import models.aaa.Node;
import models.re.IItem;
import models.re.IRank;

@Entity
public class Rank extends Node implements IRank {
	
	Double value = 0.0;
	
	@ManyToOne(fetch=FetchType.LAZY)
	private Item source = null;
	
	@ManyToOne(fetch=FetchType.LAZY)
	private Item target = null;
	
	Rank() {
		
	}
	
	Rank(IItem source, IItem target, Double value) throws Exception {
		if(target.getType()!=Type.ACTOR) throw new Exception("Rank target have to be an ACTOR");
		this.source=(Item)source;
        this.target=(Item)target;  
        this.value=value;
	}

	@Override
	public IItem getTarget() {
		// TODO Auto-generated method stub
		return null;
	}

}

